package cn.framelife.rainbow.db.oracle;

import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.Statement;

import cn.framelife.rainbow.db.BaseTable;

/**
 * Oracle的数据表相关
 * 
 * @author 潘广伟 p_3er@qq.com  
 * @date 2014-1-6 下午6:24:57
 */
public class OracleTable extends BaseTable{

	public OracleTable(String tableName, DatabaseMetaData metaData) {
		super(tableName, metaData);
	}
	
	public String getTableComment(String tableName, Connection conn) throws Exception {
		Statement st = null;
		ResultSet rs = null;
		String result = tableName;
		st = conn.createStatement();
		rs = st.executeQuery("select t.comments from ALL_TAB_COMMENTS t where t.table_name='"
				+ tableName + "'");
		while (rs.next()) {
			result = rs.getString(1);
		}
		return result;
	}
}
